﻿using ConfExpert.Forms.Base;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevTeam;

namespace ConfExpert.Forms.Aksesuar
{
    public partial class ManuelIslemler : XForm
    {
        private string SpName { get; set; }
        private string FK { get; set; }
        public ManuelIslemler(string SpName, string FK)
        {
            InitializeComponent();
            this.SpName = SpName;
            this.FK = FK;
        }

        private void ManuelIslemler_Load(object sender, EventArgs e)
        {
            bbiTarih1.EditValue = DateTime.Now.AddDays(-7);

            gvMaster.Init(SpName, bbiTarih1.EditValue, bbiTarih2.EditValue);
            gvMaster.AddDetailGrid(gvDetail, FK);

            gvMaster.BestFitColumns();
            gvDetail.BestFitColumns();

            gvMaster.AddSummary();
            gvDetail.AddSummary();

            bbiRefresh.ItemClick += bbiRefresh_ItemClick;
        }

        void bbiRefresh_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            gvMaster.RefreshDataSource(SpName, bbiTarih1.EditValue, bbiTarih2.EditValue);
        }
    }
}
